package jsyf.oa.web.system;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import jsyf.com.util.BaseUtils;
import jsyf.com.util.ResponseUtils;
import jsyf.oa.facade.system.AuditAndCopierFacade;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@Api(value = "审核人和抄送人配置", description = "审核人和抄送人配置")
@Controller
@RequestMapping("/auditAndCopier")
public class AuditAndCopierController {

    @Resource
    private AuditAndCopierFacade auditAndCopierFacade;

    @RequestMapping(value = "/save.json", method = RequestMethod.POST)
    public void save(HttpServletResponse response, @RequestBody String jsonData) {
        Boolean result = auditAndCopierFacade.save(jsonData);
        JSONObject objResult = new JSONObject();
        objResult.put("success", result);
        ResponseUtils.putJsonResponse(response, BaseUtils.succsessObjRespond(objResult));
    }

    @RequestMapping(value = "/getAuditAndCopierService.json", method = RequestMethod.POST)
    public void getAuditAndCopierService(HttpServletResponse response, @RequestBody String jsonData) {
        JSONObject result = auditAndCopierFacade.getAuditAndCopierService(jsonData);
        ResponseUtils.putJsonResponse(response, BaseUtils.succsessObjRespond(result));
    }

}
